﻿Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls


<DefaultProperty("Text"), ToolboxData("<{0}:ReadOnlyCheckBox runat=server></{0}:ReadOnlyCheckBox>")> _
Public Class ReadOnlyCheckBox
    Inherits CheckBox

    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
        If _readonly = True Then
            MyBase.Attributes.Add("onClick", "return false;")
        End If
        MyBase.Render(writer)
    End Sub

    Dim _readonly As Boolean

    <Bindable(True), Category("Appearance"), DefaultValue(False)>
    Public Property ReadOnlyStyle() As Boolean
        Get
            Return _readonly
        End Get

        Set(ByVal Value As Boolean)
            _readonly = Value
        End Set
    End Property

End Class
